import os
import time

import requests
from httprunner import __version__
# from mysqlDB import MysqlDb

#定义查询数据 sql 的方法
# mysqlDB = MysqlDb()

def get_httprunner_version():
    return __version__


def sum_two(m, n):
    return m + n


def sleep(n_secs):
    time.sleep(n_secs)

def url():

    url = 'http://%s.alpha.daofengdj.com' % os.getenv("api_host")
    if url == 'http://None.alpha.daofengdj.com':
        return 'http://www.alpha.daofengdj.com'
    else:
        return url


def get_token():
    params = {
            'password': '',
            'source': '301',
            'area_num': '86',
            'mobile': '18538285467',
            'registration_JGID': '1104a897927dd7c9e39',
            'message_code': 9999
        }

    r = requests.post(url=f'{url()}/pw/app/api/v2/mobileLogin.json', json=params).json()
    token = r['data']['token']
    return token

def int_to_str(arg):
    return str(arg)

def str_to_int(arg):
    return int(arg)


